package com.bjpowernode.springboot;

import com.bjpowernode.springboot.service.StudentService;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;


@SpringBootApplication
public class Application {

    public static void main(String[] args) {

        /**
         * springboot程序启动后，返回值是configurableApplicationContext,它是一个spring容器
         * 相当于spring容器中ClasspathXmlApplicationContext
         */

        //获取springboot容器
        ConfigurableApplicationContext applicationContext = SpringApplication.run(Application.class, args);
        StudentService studentService = (StudentService) applicationContext.getBean("studentServiceImpl");

        String say = studentService.sayHello();
        System.out.println(say);


    }

}
